home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / misc / xref_v1.1.lha / XRef / Install / install < prev   
Encoding:
Text File  |  1995-01-16  |  20.0 KB  |  632 lines

  1. ; xref.install
  2. ;
  3. ; $VER: xref.install 1.12 (15.01.95)
  4. ;
  5. ; by
  6. ;
  7. ; Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  8. ;
  9. ; (C) Copyright 1994,1995
  10. ; All Rights Reserved !
  11. ;
  12.  
  13. (complete 0)
  14. (delopts "oknodelete" "force" "askuser")
  15.  
  16. ; root path for the application to install
  17.  
  18. (set gpath
  19. (cat "/"
  20. ))
  21.  
  22. (if (= @language "english")
  23.     (
  24.         (set default_lang 2)
  25.  
  26.         (set #author
  27.         (cat "Stefan Ruppert\n"
  28.              "Windthorststraße 5\n"
  29.              "65439 Flörsheim am Main\n"
  30.              "GERMANY\n"
  31.              "EMail : ruppert@vs3.informatik.fh-wiesbaden.de\n"
  32.         ))
  33.  
  34.         (set #bad-kick
  35.         (cat "You must be using Kickstart 2.04 to use the xref.library system"
  36.         ))
  37.  
  38.         (set #install-remove
  39.         (cat "Would you install or remove the XRef-System ?"
  40.         ))
  41.  
  42.         (set #install
  43.         (cat "Install"
  44.         ))
  45.  
  46.         (set #remove
  47.         (cat "Remove"
  48.         ))
  49.  
  50.         (set #which-disk
  51.         (cat "Please select the directory to install the XRef-System to :"
  52.         ))
  53.  
  54.         (set #which-disk-help
  55.         (cat "\nYou enter here the disk and direcotry , you want to install"
  56.              " the XRef-System.\n\n\n"
  57.              @askdir-help
  58.         ))
  59.  
  60.         (set #disk-ok
  61.         (cat "Would you install into this direcory :\n"
  62.         ))
  63.  
  64.         (set #disk-ok-help
  65.         (cat "If you would not install in this directory,\n"
  66.              "select no. And select the right one !\n"
  67.         ))
  68.  
  69.         (set #install-dir
  70.         (cat "Please select topics to install :"
  71.         ))
  72.  
  73.         (set #install-dir-help
  74.         (cat "Tools : command line tools for handling with the xref.library. "
  75.              "These tools and the xref.library are the basic parts "
  76.              "of the XRef-System. Need about 120K.\n\n"
  77.              "Tools-Source : C source of the command tools. Need about 400K.\n\n"
  78.              "Documentation : ASCII-Documentation for all tools, XRef-System and the "
  79.              "xref.library. Need about 120K.\n\n"
  80.              "AmigaGuide Doc. : AmigaGuide Documentation for all tools, XRef-System and "
  81.              "the xref.library. Need about 180K.\n\n"
  82.              "V40 XRef-Files : XReffiles for all V40 includes and AutoDocs. Need about "
  83.              "180K.\n\n"
  84.              "Programmer-Files : include and link-library files. Need about 70K.\n\n"
  85.              "Projects/Scripts : some example scripts to generate system xreffiles and guides. "
  86.              "Need about 1K.\n\n"
  87.              "AReexx-Scripts  : some examples. Need about 10K.\n\n"
  88.              "Goodies : Some usefull stuff. Need about 60K.\n\n"
  89.              "Config-Files : Configuration files are copied to Sys:Config/XRef directrory "
  90.              "these files are needed by the xref.library and some tools. The files are set "
  91.              "up correctly for you with this installation! Need about 5K in your Sys: partition.\n"
  92.         ))
  93.  
  94.         (set #copy-config-files-help
  95.         (cat "This copies the xref.prefs file and the xrefconvert def-files"
  96.              "to the Sys:Config directory. The xref.library uses the xref.prefs"
  97.              "file to setup some values (see docs...). The xrefconvert tool uses"
  98.              "some files,which contain some convert definitions"
  99.         ))
  100.  
  101.         (set #select-include-dir
  102.         (cat "Please select include directory for xref-inlcudes"
  103.         ))
  104.  
  105.         (set #select-include-dir-help
  106.         (cat "Select here the include directoy, in which the xref-includes are "
  107.              "copied. The includes are copied to <your-include>/libraries, "
  108.              "<your-include>/clib, <your-include>/pragmas, <your-include>/proto "
  109.              "and <your-include>/fd directories "
  110.         ))
  111.  
  112.         (set #copy-config-to-sys
  113.         (cat "Use \"Sys:Config/XRef\" as the xref config directory ?"
  114.         ))
  115.  
  116.         (set #copy-config-to-sys-help
  117.         (cat "The config directory is needed by the xref.library ! "
  118.              "If you don`t want in the Sys: partition just anwser with "
  119.              "No and select a directory of your choice !"
  120.         ))
  121.  
  122.         (set #xreffiles-dir
  123.         (cat "XRefFiles diretory to %s ?"
  124.         ))
  125.  
  126.         (set #xreffiles-dir-help
  127.         (cat "If you don`t want this location, choose No and select an other "
  128.              "directory !"
  129.         ))
  130.  
  131.         (set #which-xreffiles-dir
  132.         (cat "Select the directory to hold all XRefFiles !"
  133.         ))
  134.  
  135.         (set #which-xreffiles-dir-help
  136.         (cat "This directory is set up in the xref.prefs file, so the library "
  137.              "can locate any xreffile accessed only via the filename !"
  138.         ))
  139.  
  140.         (set #which-config-dir
  141.         (cat "Please select the xref config dir !"
  142.         ))
  143.  
  144.         (set #which-config-dir-help
  145.         (cat "This directory is needed by the xref.library and the tools !"
  146.         ))
  147.  
  148.         (set #backup-config
  149.         (cat "Making a backup of your old XRef settings :"
  150.         ))
  151.  
  152.         (set #copy-golded-scripts
  153.         (cat "Copy GoldEd ARexx scripts to GoldEd:ARexx ?"
  154.         ))
  155.  
  156.         (set #copy-golded-scripts-help
  157.         (cat "Copies all ARexx scripts of the XRef-System for\n"
  158.              "GoldEd (at the moment only one) !"
  159.         ))
  160.  
  161.         (set #copy-golded-xrefapi
  162.         (cat "Install the GoldED XRefAPI-Client to GoldED:API/XRef ?"
  163.         ))
  164.  
  165.         (set #copy-golded-xrefapi-help
  166.         (cat "This GoldED API-Client uses the xref.library to complete "
  167.              "phrases ! It provides a new ARexx command to do this !"
  168.         ))
  169.  
  170.         (set #xref-library
  171.         (cat "Install xref.library"
  172.         ))
  173.  
  174.         (set #rexxxref-library
  175.         (cat "Install rexxxref.library"
  176.         ))
  177.  
  178.         (set #install-german-catalog
  179.         (cat "Install german xref-tools.catalog ?"
  180.         ))
  181.  
  182.         (set #install-german-catalog-help
  183.         (cat "This catalog is currently used by the AGuideXRefV39 program !"
  184.         ))
  185.  
  186.         (set #have-fun
  187.         (cat "Just have fun with the XRef-System !\n"
  188.              "If you have any idea or suggestions\nplease contact me !\n"
  189.              #author
  190.         ))
  191.  
  192.         (set #remove-really
  193.         (cat "Oh, You would not use the XRef-System ?\n\n"
  194.              "So I can`t help you ! But if you only missed a\n"
  195.              "absolutely needed feature contact me :\n"
  196.              #author
  197.         ))
  198.  
  199.         (set #remove-xrefdir
  200.         (cat "Where is the XRef-System main directory\n"
  201.              "on your system ?"
  202.         ))
  203.  
  204.         (set #remove-dir
  205.         (cat "Are you sure to delete this directoy :\n"
  206.         ))
  207.  
  208.         (set #removed-all
  209.         (cat "So the XRef-System no more waste space\n"
  210.              "on your system !"
  211.         ))
  212.     )
  213. ) ; end of language english
  214.  
  215. ; ROM >= 2.04 ?
  216.  
  217. (set sys-version (/ (getversion) 65536))
  218.  
  219. (if (< sys-version 37)
  220.     (abort #bad-kick)
  221. )
  222.  
  223. ; check if the XRef-System is installed
  224. (if (exists "Libs:xref.library")
  225.     (set install (askchoice (prompt #install-remove)
  226.                             (help @askchoice-help)
  227.                             (choices #remove
  228.                                      #install)
  229.                             (default 1)
  230.                  )
  231.     )
  232.     ; else
  233.     (set install 1)
  234. )
  235.  
  236. (if (= install 1)
  237.     (
  238.         (set target "Work:")
  239.         (set install 0)
  240.         (while (= install 0)
  241.             (
  242.                 ; get the destination directory !
  243.                 (set target (askdir (prompt #which-disk)
  244.                                     (help #which-disk-help)
  245.                                     (default target)
  246.                             )
  247.                 )
  248.                 (set install (askbool (prompt (cat #disk-ok target))
  249.                                       (help #disk-ok-help)
  250.                                       (default 1)
  251.                              )
  252.                 )
  253.             )
  254.         )
  255.  
  256.         ; get what to install ?
  257.         (set sel_basedir     0)
  258.         (set sel_toolsdir    1)
  259.         (set sel_arexxscript 2)
  260.         (set sel_toolssrcdir 3)
  261.         (set sel_docdir      4)
  262.         (set sel_guidedir    5)
  263.         (set sel_xrefdir     6)
  264.         (set sel_prgdir      7)
  265.         (set sel_exampledir  8)
  266.  
  267.         (set dirs (askoptions (prompt #install-dir)
  268.                               (help #install-dir-help)
  269.                               (choices "Config files and library (needed)"
  270.                                        "Tools"
  271.                                        "ARexx scripts"
  272.                                        "Tools-Source"
  273.                                        "Documentation (#?.doc)"
  274.                                        "AmigaGuide Doc. (#?.guide)"
  275.                                        "V40 - XRefFiles"
  276.                                        "Programmer-Files (#?.h,#?.lib)"
  277.                                        "Example generation scripts/icons"
  278.                               )
  279.                   )
  280.         )
  281.  
  282.         ; install german catalog ?
  283.         (if (IN dirs sel_toolsdir)
  284.             (if (>= sys-version 39)
  285.                 (set install-catalog 
  286.                      (askbool (prompt #install-german-catalog)
  287.                               (help #install-german-catalog-help))
  288.                 )
  289.             )
  290.         )
  291.  
  292.         ; get include directoy !
  293.         (if (IN dirs sel_prgdir)
  294.             (if (exists "include:" (noreq))
  295.                 ; TRUE if condition
  296.                 (
  297.                     (set inc-dir (askdir (prompt #select-include-dir)
  298.                                          (help #select-include-dir-help)
  299.                                          (default "include:")
  300.                                  )
  301.                     )
  302.                 )
  303.                 ; else
  304.                 (
  305.                     (set inc-dir (tackon target "include"))
  306.                 )
  307.             )
  308.         )
  309.  
  310.         (if (IN dirs sel_basedir)
  311.             (
  312.                 ; get configdir !
  313.                 (if (askbool (prompt #copy-config-to-sys)
  314.                              (help #copy-config-to-sys-help))
  315.                     (
  316.                         (set configdir ("Sys:Config/XRef"))
  317.                     )
  318.                 ;   else
  319.                     (
  320.                         (set envvariable 1)
  321.                         (set configdir (askdir (prompt #which-config-dir)
  322.                                                (help #which-config-dir-help)
  323.                                                (default target)
  324.                                        )
  325.                         )
  326.                     )
  327.                 )
  328.  
  329.                 ; get xreffiles dir !
  330.                 (if (askbool (prompt (#xreffiles-dir (tackon target "XRef")))
  331.                              (help #xreffiles-dir-help))
  332.                     (
  333.                         (set xreffilesdir (tackon target "XRef"))
  334.                     )
  335.                 ;     else
  336.                     (
  337.                         (set xreffilesdir (askdir (prompt  #which-xreffiles-dir)
  338.                                                   (help #which-xreffiles-dir-help)
  339.                                                   (default target)
  340.                                           )
  341.                         )
  342.                     )
  343.                 )
  344.  
  345.                 ; get golded stuff !
  346.  
  347.                 (if (exists "GoldEd:" (noreq))
  348.                     (
  349.                         (set golded-arexx (askbool (prompt #copy-golded-scripts)
  350.                                                    (help #copy-golded-scripts-help)
  351.                                           )
  352.                         )
  353.  
  354.                         (set golded-api   (askbool (prompt #copy-golded-xrefapi)
  355.                                                    (help #copy-golded-xrefapi-help)
  356.                                           )
  357.                         )
  358.                     )
  359.                 )
  360.             )
  361.         )
  362.  
  363.         (complete 10)
  364.  
  365.         (if (IN dirs sel_toolsdir)
  366.             (
  367.                 (makedir (tackon target "Tools"))
  368.                 (copyfiles (source (tackon gpath "Tools.info"))
  369.                            (dest target)
  370.                 )
  371.                 (copyfiles (source (cat gpath "tools/c"))
  372.                            (dest (tackon target "Tools/c"))
  373.                            (all)
  374.                            (infos)
  375.                 )
  376.                 (copyfiles (source (cat gpath "tools/icons"))
  377.                            (dest (tackon target "Tools/Icons"))
  378.                            (all)
  379.                            (infos)
  380.                 )
  381.  
  382.                 (if install-catalog
  383.                         (copyfiles (source (cat gpath "catalogs/deutsch/xref-tools.catalog"))
  384.                                    (dest "locale:catalogs/deutsch")
  385.                         )
  386.                 )
  387.             )
  388.         )
  389.  
  390.         (if (IN dirs sel_arexxscript)
  391.             (
  392.                 (copyfiles (source gpath)
  393.                            (dest target)
  394.                            (pattern "ARexx#?")
  395.                            (infos)
  396.                 )
  397.             )
  398.         )
  399.  
  400.         (complete 20)
  401.  
  402.         (if (IN dirs sel_toolssrcdir)
  403.             (
  404.                 (makedir (tackon target "Tools"))
  405.                 (copyfiles (source (tackon gpath "Tools.info"))
  406.                            (dest target)
  407.                 )
  408.                 (copyfiles (source (tackon gpath "Tools"))
  409.                            (dest (tackon target "Tools"))
  410.                            (pattern "(Source#?|Lib#?|Rexx#?)")
  411.                            (infos)
  412.                 )
  413.                 (copyfiles (source gpath)
  414.                            (dest target)
  415.                            (pattern "Goodies#?")
  416.                            (infos)
  417.                 )
  418.             )
  419.         )
  420.  
  421.         (complete 30)
  422.  
  423.         (if (IN dirs sel_docdir)
  424.             (copyfiles (source gpath)
  425.                        (dest target)
  426.                        (pattern "Doc#?")
  427.                        (infos)
  428.             )
  429.         )
  430.  
  431.         (complete 40)
  432.  
  433.         (if (IN dirs sel_guidedir)
  434.             (copyfiles (source gpath)
  435.                        (dest target)
  436.                        (pattern "Help#?")
  437.                        (infos)
  438.             )
  439.         )
  440.  
  441.         (complete 50)
  442.  
  443.         (if (IN dirs sel_xrefdir)
  444.             (copyfiles (source (tackon gpath "XRef"))
  445.                        (dest xreffilesdir)
  446.                        (pattern "#?")
  447.             )
  448.         )
  449.  
  450.         (complete 60)
  451.  
  452.         (if (IN dirs sel_prgdir)
  453.             (
  454.                 (copyfiles (source (tackon gpath "include"))
  455.                            (choices "clib" "libraries" "fd" "pragmas" "proto")
  456.                            (dest inc-dir)
  457.                 )
  458.                 (copyfiles (source gpath)
  459.                            (dest target)
  460.                            (choices "lib" "myinclude")
  461.                 )
  462.             )
  463.         )
  464.  
  465.         (complete 65)
  466.  
  467.         (if (IN dirs sel_exampledir)
  468.             (
  469.                 (copyfiles (source gpath)
  470.                            (dest target)
  471.                            (pattern "Projects#?")
  472.                            (infos)
  473.                 )
  474.             )
  475.         )
  476.  
  477.         (complete 70)
  478.  
  479.         (if (IN dirs sel_basedir)
  480.             (
  481.                 ; make configuration
  482.                 (if envvariable
  483.                     (
  484.                         (textfile (dest "ENVARC:XREFCONFIGDIR")
  485.                                   (append configdir)
  486.                         )
  487.                         (textfile (dest "ENV:XREFCONFIGDIR")
  488.                                   (append configdir)
  489.                         )
  490.                     )
  491.                 )
  492.  
  493.                 ; backup old config
  494.  
  495.                 (if (exists (tackon configdir "xref.prefs"))
  496.                     (
  497.                         (working #backup-config)
  498.                         (rename configdir (cat configdir "_Old"))
  499.                     )
  500.                 )
  501.  
  502.                 (copyfiles (source (cat gpath "config/xref"))
  503.                            (dest configdir)
  504.                            (all)
  505.                 )
  506.  
  507.                 ; generate new config file
  508.  
  509.                 (textfile (dest (tackon configdir "xref.prefs"))
  510.                           (append (cat "XREFDIR DIR " xreffilesdir "\n"))
  511.                           (include (tackon gpath "config/xref/xref_std.prefs"))
  512.                 )
  513.                 (delete (tackon configdir "xref_std.prefs" (optional "force")))
  514.  
  515.  
  516.                 (complete 80)
  517.  
  518.                 ; copy GoldED support stuff
  519.  
  520.                 (if (exists "GoldEd:" (noreq))
  521.                     (
  522.                         (if golded-arexx
  523.                             (copyfiles (source (cat gpath "arexx"))
  524.                                        (dest "GoldED:ARexx")
  525.                                        (pattern "#?.ged")
  526.                                        (infos)
  527.                             )
  528.                         )
  529.                         (if golded-api
  530.                             (
  531.                                 (makedir "GoldED:API/XRef" (infos))
  532.                                 (copyfiles (source (tackon gpath "tools/golded"))
  533.                                            (dest "GoldED:API/XRef")
  534.                                            (all)
  535.                                            (infos)
  536.                                 )
  537.                             )
  538.                         )
  539.                     )
  540.                 )
  541.  
  542.                 (complete 90)
  543.  
  544.                 ; check , which of the library fits best
  545.  
  546.                 (if (< sys-version 39)
  547.                     (
  548.                         (set library (tackon gpath "libs/v37/xref.library"))
  549.                     )
  550.                     ; else
  551.                     (
  552.                         (set library (tackon gpath "libs/v39/xref.library"))
  553.                     )
  554.                 )
  555.  
  556.  
  557.                 (copylib (prompt #xref-library)
  558.                          (source library)
  559.                          (dest "LIBS:")
  560.                 )                       
  561.  
  562.                 (copylib (prompt #rexxxref-library)
  563.                          (source (tackon gpath "libs/rexxxref.library"))
  564.                          (dest "LIBS:")
  565.                 )
  566.  
  567.                 (copyfiles (source (cat gpath "readme/english"))
  568.                            (dest target)
  569.                            (newname "ReadMe")
  570.                            (infos)
  571.                            (files)
  572.                            (noposition)
  573.                 )
  574.             )
  575.         )
  576.  
  577.         (complete 100)
  578.  
  579.         (set @default-dest target)
  580.  
  581.         ; show ReadMe file if this is a base installation
  582.         (if (IN dirs sel_basedir)
  583.             (run (cat "run >NIL: <NIL: Sys:Utilities/MultiView " (tackon target "ReadMe")))
  584.         )
  585.  
  586.         ; end of installation
  587.         (exit (#have-fun))
  588.     ) ; else remove
  589.     (
  590.         (set install 0)
  591.         (if (askbool (prompt #remove-really)
  592.                      (help @askbool-help))
  593.  
  594.             (
  595.                 (set xrefdir (askdir (prompt #remove-xrefdir)
  596.                                      (help @askdir-help)
  597.                                      (default "XRef:")))
  598.  
  599.                 (if (askbool (prompt (cat #remove-dir xrefdir))
  600.                              (help @askbool-help))
  601.                     (
  602.                         (run (cat "delete >NIL: <NIL: " (tackon xrefdir "#?") " all"))
  603.  
  604.                         (if (NOT (= (trap 5 (getenv "XREFCONFIGDIR")) 5))
  605.                             (
  606.                                 (set xrefconfigdir (getenv "XREFCONFIGDIR"))
  607.                                 (trap 4 (delete "ENVARC:XREFCONFIGDIR"))
  608.                                 (trap 4 (delete "ENV:XREFCONFIGDIR"))
  609.                                 (run (cat "delete >NIL: <NIL: " (tackon xrefconfigdir "#?") " ALL "))
  610.                             )
  611.                         )
  612.  
  613.                         (if (NOT (= (trap 5 (set xrefdir (getenv "XREFDIR"))) 5))
  614.                             (
  615.                                 (trap 4 (delete "ENV:XREFDIR"))
  616.                                 (run (cat "delete >NIL: <NIL: " (tackon xrefdir "#?") " ALL "))
  617.                             )
  618.                         )
  619.                         (trap 4 (delete "LIBS:xref.library"))
  620.                         (trap 4 (delete "LIBS:rexxxref.library"))
  621.  
  622.                         (message #removed-all)
  623.                     )
  624.                 )
  625.             )
  626.         )
  627.         ; end of deletion
  628.     )
  629. )
  630. (exit (quiet))
  631.  
  632.